import React from 'react';
import {
  Router,
  Route,
  // IndexRoute,
  IndexRedirect,
} from 'dva/router';
import frame from './views/frame';
import appList from './views/app/list';
import indexList from './views/index/list';
import datasourceList from './views/datasource/list';
import controlList from './views/control/list';
import createIndex from './views/index/createIndex';


export default function ({ history }) { // eslint-disable-line
  return (<Router history={history}>
    <Route path="/" component={frame}>
      <IndexRedirect to="/app" />
      <Route path="app" component={appList}>
      </Route>
      <Route path="index" component={indexList}>
      </Route>
      <Route path="datasource" component={datasourceList}>
      </Route>
      <Route path="control" component={controlList}>
      </Route>
      <Route path="createIndex" component={createIndex}>
      </Route>
      <Route path="/editIndex/:id" component={createIndex}/>
    </Route>
  </Router>);
}
